package org.serendepity.client.ui.widgets;

import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;


public class AccountsView extends VLayout {
    private static final String DESCRIPTION = "AccountsView";
    private static final String CONTEXT_AREA_WIDTH = "*";

    public AccountsView() {
        super();

        GWT.log("init AccountsView()...", null);

        // initialise the Accounts View layout container
        this.addStyleName("crm-ContextArea");
        this.setWidth(CONTEXT_AREA_WIDTH);

        // add the Tool Bar, List Grid, Status Bar and Jump Bar to the Accounts View layout container
        this.addMember(new ToolBar());
        this.addMember(new ContextAreaListGrid());
        this.addMember(new StatusBar());
        this.addMember(new JumpBar());
    }

    public static class Factory implements ContextAreaFactory {

        private String id;

        public Canvas create() {
            AccountsView view = new AccountsView();
            id = view.getID();

            GWT.log("AccountsView.Factory.create()->view.getID() - " + id, null);
            return view;
        }

        public String getID() {
            return id;
        }

        public String getDescription() {
            return DESCRIPTION;
        }
    }
}
